package com.shensi.api.admin.client.system;

import com.shensi.api.admin.client.fallback.system.SysNoticeClientFallBack;
import com.shensi.api.admin.domian.system.SysNotice;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.page.TableDataInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author: budian
 * @since: 2023/11/30
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = SysNoticeClientFallBack.class)
@Component
public interface SysNoticeClient {
    /**
     * 获取通知公告列表
     */
    @GetMapping("/list")
    public TableDataInfo list(@SpringQueryMap SysNotice notice);

    /**
     * 根据通知公告编号获取详细信息
     */
    @GetMapping(value = "/{noticeId}")
    public AjaxResult getInfo(@PathVariable("noticeId") Long noticeId);

    /**
     * 新增通知公告
     */
    @PostMapping
    public AjaxResult add(@RequestBody SysNotice notice);

    /**
     * 修改通知公告
     */
    @PutMapping
    public AjaxResult edit(@RequestBody SysNotice notice);

    /**
     * 删除通知公告
     */
    @DeleteMapping("/{noticeIds}")
    public AjaxResult remove(@PathVariable("noticeIds") Long[] noticeIds);
}
